package com.train.api;

import com.train.api.fallback.TicketApiFallback;
import com.train.common.constants.ApiConstants;
import com.train.common.resp.CommonResp;
import com.train.dto.TicketDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(
        contextId = "ticketApi",
        name = ApiConstants.TICKET_NAME,
        path = ApiConstants.TICKET_PREFIX,
        fallback = TicketApiFallback.class)
public interface TicketApi {

    String PREFIX = "/ticket";

    @PostMapping(PREFIX + "/add")
    CommonResp batchSaveTicket(@RequestBody List<TicketDTO> dto);

//    CommonResp existsTicket(LocalDate date, String trainCode);
}
